var vectorYuanquLayer=new ol.layer.Vector({
    title: '行政区',
    visible:true,
    source: new ol.source.Vector({
        url: 'http://172.19.18.223:5555/rdbmsserver?table=lyg',
        format: new ol.format.GeoJSON()
    }),
    style: new ol.style.Style({
        stroke: new ol.style.Stroke({
            color: 'rgba(0,0,255,1)',
            lineDash: [4],
            width: 2
        }),
        fill: new ol.style.Fill({
            color: 'rgba(0, 0, 0, 0)'
        })
    }),
    declutter: false
});

var QYLayer=new ol.layer.Vector({
    title: '企业',
    visible:true,
    source: new ol.source.Vector({
        url: 'http://172.19.18.223:5555/rdbmsserver?table=qy',
        format: new ol.format.GeoJSON()
    }),
    style: styleFunctionQY,
    declutter: false
});

var styleFunctionQY = function(feature,resolution) {

    var tmpstyle=styles[feature.get('type')];
    tmpstyle.getText().setText('');
    return tmpstyle;

}

var styles = {
    '化工': new ol.style.Style({
        image: new ol.style.Icon({src: 'img/point.png'}),
        text: new ol.style.Text({font: '16px Calibri,sans-serif',
            overflow: true,
            fill: new ol.style.Fill({
                color: '#000'
            }),
            stroke: new ol.style.Stroke({
                color: '#fff',
                width: 3
            })
        })
    }),
    '能源': new ol.style.Style({
        image: new ol.style.Icon({
            src: 'img/point2.png'
        }),
        text: new ol.style.Text({ //文本样式
            font: '16px Calibri,sans-serif',
            overflow: true,
            fill: new ol.style.Fill({
                color: '#000'
            }),
            stroke: new ol.style.Stroke({
                color: '#fff',
                width: 3
            })
        })
    }),
    '环保': new ol.style.Style({
        image: new ol.style.Icon({
            src: 'img/point3.png'
        }),
        text: new ol.style.Text({ //文本样式
            font: '16px Calibri,sans-serif',
            overflow: true,
            fill: new ol.style.Fill({
                color: '#000'
            }),
            stroke: new ol.style.Stroke({
                color: '#fff',
                width: 3
            })
        })
    })

}


YWLayer.getLayers().push(vectorYuanquLayer);

YWLayer.getLayers().push(QYLayer);



setCenterZoom(13288933,4100898,10);